Learn R Programming

rcqp (version 0.5)

Type and token: Print values of cqp attribute

Description

Get vectors of tokens or types for a cqp attribute.

Usage

ntype(attribute, ...)

types(attribute, ...)

nregion(attribute, ...)

regions(attribute, ...)

ntoken(attribute, ...)

tokens(attribute, ...)

# S3 method for cqp_attr ntype(attribute, ...) # S3 method for cqp_attr types(attribute, ...) # S3 method for cqp_attr nregion(attribute, ...) # S3 method for cqp_attr regions(attribute, ...) # S3 method for cqp_attr ntoken(attribute, ...) # S3 method for cqp_attr tokens(attribute, ...)

Arguments

attribute

A cqp_attr object, created with $.cqp_corpus.

...

Ignored.

Value

For positional attributes :

  • ntoken is the number of tokens (== size(corpus))

  • tokens is a character vector with the actual list of tokens

  • ntype is the number of different values

  • types is a character vector with the actual different values

For structural attributes :

  • nregion is the actual number of regions (a numeric vector of length 1)

  • tokens the region id ("struc") of each token (a numeric vector)

  • regions (only if the structural attribute "has values") : the values found on each region (a character vector)

References

http://cwb.sourceforge.net/documentation.php

See Also

$.cqp_corpus.

Examples

Run this code
# NOT RUN {
c <- corpus("DICKENS");
pos <- c$pos
types(pos);
ntokens(types(pos));
# }

Run the code above in your browser using DataLab